package repository;

import java.util.ArrayList;
import java.util.List;

public class WalletEntity {
    private int id;
    private double balance;
    private List<String> flows;
    private double freezeBalance;
    private boolean canOverdraft;
    private double overdraftLimit;

    public WalletEntity(int id) {
        this.id = id;
        this.balance = 0;
        this.flows = new ArrayList<>();
        flows.add("钱包初始金额：0");
        this.freezeBalance = 0;
        this.canOverdraft = false;
        this.overdraftLimit = 0;
    }
    public WalletEntity(int id, double balance){
        this.id = id;
        this.balance = balance;
        this.flows = new ArrayList<>();
        flows.add("钱包初始金额：" + String.valueOf(balance));
        this.freezeBalance = 0;
        this.canOverdraft = false;
        this.overdraftLimit = 0;
    }

    public int getId(){ return this.id; }

    public double getBalance() {
        return this.balance;
    }

    public List<String> getFlows() {
        return this.flows;
    }

    public double getFreezeBalance() {
        return this.freezeBalance;
    }

    public boolean getCanOverdraft(){
        return this.canOverdraft;
    }

    public double getOverdraftLimit() {
        return this.overdraftLimit;
    }

    public void setBalance(double newBalance) {
        this.balance = newBalance;
    }

    public void setFreezeBalance(double freezeBalance) {
        this.freezeBalance = freezeBalance;
    }

    public void setCanOverdraft(boolean can){
        this.canOverdraft = can;
    }

    public void setOverdraftLimit(double limit){
        this.overdraftLimit = limit;
    }

    public void addFlows(String flow) { flows.add(flow); }
}
